cmake_minimum_required(VERSION 3.10.0)
project(hello VERSION 0.1.0 LANGUAGES C)

# 添加可执行文件
add_executable(hello main.c)

# set 这个指令是可以用来设置变量
set(DATA_STRUCTURE_PATH ${CMAKE_SOURCE_DIR}/data_structure)

# 包含目录中的头文件(头文件可以自动加载，
# 不需要手动列出，给出头文件在的文件夹就可以了)
target_include_directories(hello PUBLIC 
${DATA_STRUCTURE_PATH}/linear_structure
${DATA_STRUCTURE_PATH}/tree_structure
${DATA_STRUCTURE_PATH}/find
${DATA_STRUCTURE_PATH}/search
)

# 源文件列表 这种逐一列出源文件的方式是官方推荐
set(PROJECT1_SOURCES
${DATA_STRUCTURE_PATH}/linear_structure/sequence_list.c
${DATA_STRUCTURE_PATH}/linear_structure/link_list.c
${DATA_STRUCTURE_PATH}/search/binarySearch.c
${DATA_STRUCTURE_PATH}/search/block_search.c
${DATA_STRUCTURE_PATH}/linear_structure/inn.c
)

target_sources(hello PRIVATE ${PROJECT1_SOURCES})


include(CTest)

enable_testing()

set(CPACK_PROJECT_NAME ${PROJECT_NAME})

set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})

include(CPack)